import {createRouter, createWebHistory, createWebHashHistory} from 'vue-router'
import LayOut from '@/views/layout/index.vue'
import PersonSpaceal from '@/views/layout/personal_space/index.vue'

const router = createRouter({
    history: createWebHashHistory(import.meta.env.VITE_APP_ROUTER_BASE_URL || import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            redirect: '/layout'
        },
        {
            path: '/layout',
            name: 'layout',
            component: LayOut,
            children: [
                {
                    path: '/layout',
                    redirect: '/layout/index'
                },
                // #region personal_space
                {
                    path: 'personal_space',
                    name: 'personal_space',
                    component: PersonSpaceal,
                    children: [
                        {
                            path: '/layout/personal_space',
                            redirect: '/layout/personal_space/personal_infomation'
                        },
                        {
                            path: 'personal_infomation',
                            name: 'personal_infomation',
                            component: () => import('@/views/layout/personal_space/PersonalInformation.vue'),
                            meta: {
                                name_CN: '个人信息',
                                mark: 'user'
                            }
                        },
                        {
                            path: 'attention',
                            name: 'attention',
                            component: () => import('@/views/layout/personal_space/MyAttention.vue'),
                            meta: {
                                name_CN: '我的关注',
                                mark: 'user'
                            }
                        },
                        {
                            path: 'fans',
                            name: 'fans',
                            component: () => import('@/views/layout/personal_space/MyFans.vue'),
                            meta: {
                                name_CN: '我的粉丝',
                                mark: 'user'
                            }
                        },
                        {
                            path: 'watch_history',
                            name: 'watch_history',
                            component: () => import('@/views/layout/personal_space/WatchHistory.vue'),
                            meta: {
                                name_CN: '观看历史',
                                mark: 'user'
                            }
                        },
                        {
                            path: 'live_broadcast_data',
                            name: 'live_broadcast_data',
                            component: () => import('@/views/layout/personal_space/LiveBroadcastData.vue'),
                            meta: {
                                name_CN: '直播数据'
                            }
                        },
                        {
                            path: 'identity_apply',
                            name: 'identity_apply',
                            component: () => import('@/views/layout/personal_space/IdentityApply.vue'),
                            meta: {
                                name_CN: '申请中心'
                            }
                        },
                        {
                            path: 'live_broadcast_setting',
                            name: 'live_broadcast_setting',
                            component: () => import('@/views/layout/personal_space/LiveBroadcastSetting.vue'),
                            meta: {
                                name_CN: '直播设置'
                            }
                        }
                        //
                    ]
                },
                // #endregion
                // #region message_space
                {
                    path: 'message_space',
                    name: 'message_space',
                    component: () => import('@/views/layout/message_space/index.vue'),
                    children: [
                        {
                            path: '/layout/message_space',
                            redirect: '/layout/message_space/add_new_fans'
                        }, {
                            path: 'comments',
                            name: 'comments',
                            component: () => import('@/views/layout/message_space/Comments.vue'),
                            meta: {
                                name_CN: '评论和@'
                            }
                        }, {
                            path: 'add_new_fans',
                            name: 'add_new_fans',
                            component: () => import('@/views/layout/message_space/AddNewFans.vue'),
                            meta: {
                                name_CN: '新增粉丝'
                            }
                        }
                        , {
                            path: 'received_likes',
                            name: 'received_likes',
                            component: () => import('@/views/layout/message_space/ReceivedLikes.vue'),
                            meta: {
                                name_CN: '收到的赞'
                            }
                        }
                        , {
                            path: 'chat_room',
                            name: 'chat_room',
                            component: () => import('@/views/layout/message_space/ChatRoom.vue'),
                            meta: {
                                name_CN: '聊天'
                            }
                        }
                        , {
                            path: 'system_notification',
                            name: 'system_notification',
                            component: () => import('@/views/layout/message_space/SystemNotification.vue'),
                            meta: {
                                name_CN: '系统通知'
                            }
                        }
                    ]
                },
                // #endregion
                {
                    path: 'live',
                    name: 'live',
                    component: () => import("@/views/layout/live/index.vue")
                },
                {
                    path: 'anchor',
                    name: 'anchor',
                    component: () => import("@/views/layout/anchor/index.vue")
                },
                {
                    path: 'index',
                    name: 'index',
                    component: () => import("@/views/layout/home/index.vue")
                },
                {
                    path: 'search',
                    name: 'search',
                    component: () => import("@/views/layout/home/search.vue")
                },
                {
                    path: "test",
                    name: 'test',
                    component: () => import("@/views/layout/live/danmu.vue")
                }
            ]
        },

    ]
})

export default router
